<p>hello </p>
<div class="num">

</div>

<button id="btn" class="layui-btn">内部改变按钮</button>
<script>

    console.log(doc,target)

    // 组件加载完毕
    doc.hooks.onReady = function () {

        console.log("组件加载完毕")
        const btn = doc.getElementById("btn")
        const div = doc.querySelector(".num")
        btn.onclick = function () {
            const p = document.createElement("p")
            p.innerHTML = "hello"
            div.appendChild(p)
        }
    }

    // 组件改变完毕
    doc.hooks.onChange = function (e) {
        console.log(e)
        console.log("组件切换完毕")
        let p = target.getAttribute("name")
        console.log(p)
    }

</script>